package com.boot.repository;

import com.boot.entity.StuInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

@Transactional
@Repository
public interface StuInfoRepository extends JpaRepository<StuInfo, Integer>, JpaSpecificationExecutor<StuInfo> {

    List<StuInfo> findAllByName(String name);

    Boolean existsByStudentNumber(String stunum);

    StuInfo findByStudentNumber(String studentNumber);

    StuInfo findByStudentNumberAndPassword(String studentNumber, String password);

}